package com.elderly.listener;

import com.elderly.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Description 消息消费者
 * @Date 2021/10/5 9:06
 * @Created 30500
 */
@Component
public class Consumer {
    /**
     * @description 监听消息队列
     * @author 30500
     * @date 2021/10/5 9:09
     * @type [java.lang.String]
     * @return void
     */
    @RabbitListener(queues = RabbitMQConfig.TOPIC_QUEUE)
    public void listener(String message) {
        System.out.println("监听到消息" + message);
    }
}
